#include "mriowidget.h"
#include "bsonexplorermodel.h"
MRIOWidget::MRIOWidget(QWidget *parent) :
    QWidget(parent)
{
    setupUi(this);
    bsonExplorerModel=NULL;
    QObject::connect(runButton, SIGNAL(clicked()), this, SLOT(runMapReduce()));
    //connect(this->runButton,SIGNAL(clicked()),this,SLOT(runMapReduce());
}

void MRIOWidget::runMapReduce()
{
    emit mapReduceAction();
}

void MRIOWidget::setMapReduceResult(BSONObj &result)
{
    if(NULL==bsonExplorerModel)
        bsonExplorerModel=new BsonExplorerModel;
    resultTable->setModel(bsonExplorerModel);
    bsonExplorerModel->setBSONObject(result);
}

